/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.kweative.lingua.server.response;

import com.kweative.lingua.server.session.Session;
import com.kweative.network.Request;
import com.kweative.network.Response;
import com.kweative.network.Response.Status;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;

/**
 *
 * @author henrik
 */
public class ResponseHandler  {
    Response response;
    Session session;

    public ResponseHandler(Response response, Session session) {
        this.response = response;
        this.session = session;
    }

    public Response getResponse() {
        return response;
    }

    public Session getSession() {
        return session;
    }

    public void setSession(Session session) {
        this.session = session;
    }

    public void clear() {
        getResponse().clear();
    }

    public Request getRequest() {
        return getResponse().getRequest();
    }

    public void setRequest(Request request) {
        getResponse().setRequest(request);
    }


    public byte[] getBody() {
        return getResponse().getBody();
    }

    public void setBody(String body) {
        getResponse().setBody(body);
    }
    public void setBody(byte[] body) {
        getResponse().setBody(body);
    }
    public void addBody(byte[] body) {
        getResponse().addBody(body);
    }
    public void addBody(String body) {
        getResponse().addBody(body);
    }

    public HashMap<String, String> headers() {
        return getResponse().headers();
    }

    public Status getStatus() {
        return getResponse().getStatus();
    }

    public void setStatus(Status status) {
        getResponse().setStatus(status);
    }

    public void write(OutputStream out) throws IOException {
        getResponse().write(out);
    }
}
